# Maintainer: Simon Rupf <simon@rupf.net>
pkgname=convert2json
pkgver=1.1.0
pkgrel=0
pkgdesc="Utilities to convert CSV, INI, RSV, TOML, XML & YAML to JSON, including jq/jaq wrappers."
url="https://github.com/simonrupf/convert2json"
arch="all"
license="MIT"
depends="jaq"
makedepends="
	cargo
	cargo-auditable
	clang-dev
	"
source="https://github.com/simonrupf/convert2json/archive/$pkgver/convert2json-$pkgver.tar.gz"
options="net"

prepare() {
	default_prepare

	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build --release --frozen
}

check() {
	cargo test --frozen
}

package() {
	install -Dm755 target/release/cq target/release/tq target/release/rq \
	    target/release/xq target/release/yq target/release/csv2json \
	    target/release/toml2json target/release/rsv2json \
	    target/release/xml2json target/release/yaml2json \
	    -t "$pkgdir"/usr/bin
}

sha512sums="
92fbf5d363b41c1b775b1695513371f27b52a8a6b6b3dd91e7645c5bd4d5720c46df6fe85ddf5fdf3ef2958f6a4ff158cbeef30f1202de193f90655656e0919e  convert2json-1.1.0.tar.gz
"
